<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="root">
      <div id="vue-doc">
        <button @click="add">button</button>
        <div v-for="(item, index) in list" :key="">{{item.name}}</div>
      </div>
    </div>
  </body>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <script>
    const instace = new Vue({
      template: '<div>{{ msg }}</div>',
      data: function () {
        return {
          cmp: {
            id: 311164,
            unitId: 1,
            unitKey: 'normal-home_single-row-image',
            unitType: 1,
          },
          list: [
            {
              id: 1,
              name: '111'
            },
            {
              id: 2,
              name: '222'
            },
            {
              id: 3,
              name: '333'
            }
          ],
          msg: 'hello vue',
        }
      },
      methods: {
        add() {
          this.list.splice(1, {id: 4, name: '新增加的数据'})
        }
      },
      el: document.getElementById('vue-doc'),
    })
    console.log(instace.cmp)
  </script>
</html>
